package acl.sqlmaker;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import page.BaseSqlMakerImpl;

public class UserSqlMaker extends BaseSqlMakerImpl{
	protected String makeConditionStr(HttpServletRequest request){
		String condition="";
		if(request!=null){
			String keys=request.getParameter("keys");
			if(keys!=null){
			String[] all = keys.split("%20");
			for(int i = 0;i<all.length;i++){
				String n = (all[i]).trim();
				try {
					condition+=" and allContent like '%"+URLDecoder.decode(n,"utf-8")+"%'";
					
				} catch (UnsupportedEncodingException e) {
					e.printStackTrace();
				}
			}
			condition+=" and userstate=1 ";
			}
		}
		return condition;
	}
}
